package UserLogin;

import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class LogInPanel extends JPanel {

    private JTextField user;
    private JPasswordField password;
    private JLabel userLabel;
    private JLabel passwordLabel;
    private JButton okButton;
    private JButton cancelButton;

    public LogInPanel(int width, int height) {
        user = new JTextField();
        password = new JPasswordField();
        
        userLabel = new JLabel("User");
        
        passwordLabel = new JLabel("Password");
        
        okButton = new JButton("Login");
        
        cancelButton = new JButton("Cancel");

        user.setSize(new Dimension(70, 25));
        user.setMaximumSize(new Dimension(70, 25));
        user.setMinimumSize(new Dimension(70, 25));
        user.setPreferredSize(new Dimension(70, 25));

        password.setSize(new Dimension(70, 25));
        password.setMaximumSize(new Dimension(70, 25));
        password.setMinimumSize(new Dimension(70, 25));
        password.setPreferredSize(new Dimension(70, 25));

        this.setSize(new Dimension(width, height));
        this.setPreferredSize(new Dimension(width, height));
        this.setMaximumSize(new Dimension(width, height));
        this.setMinimumSize(new Dimension(width, height));

        this.add(userLabel);
        this.add(user);
        this.add(passwordLabel);
        this.add(password);
        this.add(okButton);
        this.add(cancelButton);
        this.setVisible(true);
    }

    public JTextField getUser() {
        return user;
    }

    public JPasswordField getPassword() {
        return password;
    }
    
    public JButton getOkButton(){
        return okButton;
    }

    public JButton getCancelButton() {
        return cancelButton;
    }
}
